<?php
//测试控制器类
class IndexController extends Controller{
    //动作方法
    public function index(){
        $db = M('news');
        $page = new Page($db->count(),2,3,array('pre' => ' 上一层 ', 'next' => ' 下 一页','first' =>'首页','end'=>'尾页','unit'=>'条'));
        $data = $db->limit($page->limit())->all();
        $this->assign('page',$page->show());
        $this->assign('data',$data);
        $this->display();
    }
}
